#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
# @Time    : 2022/06/08 20:18
# @Author  : elegantfrog
# @FileName: admin.py

from flask import Blueprint, current_app, request
from utils.logs import Logging
from flask_request_id import RequestID
import json

admin = Blueprint('admin', __name__, url_prefix='/admin')
req = RequestID(current_app).id
logging = Logging(__name__)


@admin.route('admin', methods=['POST'])
def login():
    try:
        msg = {
            "route": request.url_rule.rule,
            "req-params": json.loads(json.dumps(request.form))
        }
        logging.info(msg)
        return 'hello world'
    except Exception as e:
        logging.error(e)
        print(e)
        return e
